<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              height="500">
      <el-table-column prop="serviceNum"
                       label="交易流水号"
                       align="center">
      </el-table-column>
      <el-table-column prop="name"
                       label="用户"
                       align="center">
      </el-table-column>
      <el-table-column prop="amount"
                       label="退款金额"
                       align="center">
      </el-table-column>
      <el-table-column prop="type"
                       label="来源"
                       align="center">
      </el-table-column>
      <el-table-column prop="type"
                       label="支付方式"
                       align="center">
        
      </el-table-column>
      <el-table-column prop="status"
                       label="交易状态"
                       align="center">
    
      </el-table-column>
      <el-table-column prop="processingTime"
                       label="交易时间"
                       align="center">
      </el-table-column>
    </el-table>
    <el-row type="flex"
            align="middle"
            style="text-align: center">
      <el-col>
        <el-pagination @current-change="getrefund()"
                       :current-page.sync="pageNum"
                       :page-size="pageSize"
                       layout="total, prev, pager, next"
                       :total="total">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      pageNum: 1,
      pageSize: 5,
      total: 0,
      tableData: [],
      // 初始化分页参数
      pageparm: {
        currentPage: 1,
        pageSize: 5,
        total: 0,
      },
    }
  },
   //创建完毕
  created() {
    // 获取表单数据
    this.getrefund();
    // this.tableData = localStorage.getItem("successData");
  },
 
  methods: {
    getrefund() {
      this.$axios.get("/finance/deal/refund" )
      .then(res => {
        if (res.data.code == 200) {
            console.log(res.data)
           this.tableData = res.data.data;
           this.pageparm.total = res.data.data.total;
          
        }else{
           this.$message({type: 'info',message: res.data.message})
        }
      })
      .catch(err => {
          this.$message.error('数据加载失败，请稍后再试！')
      })
    },
     // 分页插件事件
    callFather(parm) {
      this.pageparm.currentPage = parm.currentPage;
      this.pageparm.pageSize = parm.pageSize;
      this.getdata();
    },
  }
}
</script>

<style scoped>
</style>
